package com.broadsoft.cluster.smartcluster;

import java.util.concurrent.Callable;

/**
 * 
* FIXME: <A few lines of description of what class is about and what it does.> 
*
* <HR/><B>Modification Block</B>
* <P>
* Version: FIXME: 1.0.1 <BR>
* Author: FIXME: luzhen
* Date: 2011-9-21
* TAG: <A short name to find out all changed made by this modification.>
* Comments: Created.
* Bug fix NO.: <If required>
* </P>
* <P>
* ... Other Modifications following above structure.
* </P>
*
 */
public interface PartitionService {

    /**
     * Execute task on the node which own partition synchronously.
     * 
     * @param partition
     * @param task
     */
    @SuppressWarnings("rawtypes")
    Object invoke(int partition, Callable task);

    /**
     * Execute task on the node which own partition asynchronously.
     * 
     * @param partition
     * @param task
     */
    void asyncInvoke(int partition, Runnable task);

}
